<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>For循环优化</title>
    </head>
    <body>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p><p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p><p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p><p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p><p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p><p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p><p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p><p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p><p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p><p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p><p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>
        <p class="btn">add</p>

        <script>
            var btnS = document.getElementsByClassName("btn");
            for (var i = 0; i < btnS.length; i++) {
                console.log(i);
            }
            for (var i = 0, len = btnS.length; i < len; i++) {
                console.log(i);
            }
        </script>
    </body>
</html>
